//
//  WHUseCertModel.h
//  WHPersonalData
//
//  Created by shengmeng chen on 2021/9/4.
//  Copyright © 2021 mac. All rights reserved.
//

#define WHUseCert_pkey       @"pkey"
#define WHUseCert_cert       @"cert"
#define WHUseCert_ce06       @"ce06"      //ce06:交换证书
#define WHUseCert_ce07       @"ce07"      //ce07:代理证书
#define WHUseCert_cacert     @"cacert"    //cacert:根证书
#define WHUseCert_uspkey     @"uspkey"   //uspkey:本手机私钥,
#define WHUseCert_uscert     @"uscert"   //uscert:本手机证书
#define WHUseCert_dwcert     @"dwcert"   //法人证书
#define WHUseCert_dwpkey     @"dwpkey"   //法人私钥

typedef enum {
    
    WHUseCertPhoneRegiserType,
    WHUseCertLegalSpaceType,

}WHUseCertType;

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface WHUseCertModel : NSObject

@property(nonatomic,copy)NSString*phone;     //本手机标识
@property(nonatomic,copy)NSString*certtyppe; //证书类型(uspkey:本手机私钥,uscert:本手机证书,ce06:交换证书,ce07:代理证书,uscert:本手机证书,dwcert：法人证书,dwpkey：法人私钥)
@property(nonatomic,copy)NSString*name;      //证书名称
@property(nonatomic,copy)NSString*cert;      //证书或公私钥信息
@property(nonatomic,copy)NSString*datatime;  //记录单位时间(排序使用,登录后修改为最新时间)
@property(nonatomic,copy)NSString*remark;    //本手机标识
@property(nonatomic,copy)NSString*ext1;      //-- 扩展1
@property(nonatomic,copy)NSString*ext2;      //-- 扩展2（证书系统版本号）
@property(nonatomic,copy)NSString*ext3;      //-- 扩展3（所属平台标识运营/体验/开发）
@property(nonatomic,copy)NSString*ext4;      //-- 扩展4 保存港号
@property(nonatomic,copy)NSString*ext5;      //-- 扩展5

/**
 *  添加模型
 *
 *  @param model             模型
 *  @param succese           添加成功回调
 *  @param failure           添加失败回调
 */
//+(void)addUseComModel:(WHUseCertModel*)model succesefulBlock:(void (^)(WHUseCertModel *model))succese andFailureBlock:(void (^)(NSString *msg))failure;
//
///**
// *  更新
// *
// *  @param sql          sql语句
// *  @param succese      更新成功回调
// *  @param failure      更新失败回调
// */
//+ (void)updateUseComModelTableWithSql:(NSString*)sql  succesefulBlock:(void (^)(WHUseCertModel *model))succese andFailureBlock:(void (^)(NSString *msg))failure;
//
////查询
//+ (void)searchWHUseCertModelWithSql:(NSString*)sqlString  succesefulBlock:(void (^)(NSArray *models))succese andFailureBlock:(void (^)(NSString *msg))failure;
////查询
//+ (void)searchCountWHUseCertModelWithSql:(NSString*)sqlString  succesefulBlock:(void (^)(int count))succese andFailureBlock:(void (^)(NSString *msg))failure;
//
///**
// *  删除模型
// *
// *  @param sql          模型
// *  @param succese      删除成功回调
// *  @param failure      删除失败回调
// */
//+ (void)deleteUseComModelTableWithSql:(NSString *)sql  succesefulBlock:(void (^)(WHUseCertModel *model))succese andFailureBlock:(void (^)(NSString *msg))failure;
//
///**********************************手机登陆************************************/
//
//+(BOOL)isExistCertUserRegiser:(NSString*)phone;
//
//+(WHUseCertModel *)getWHUseCertOperModel:(NSString *)certtyppe;
//
//+(BOOL)addOrUpdateWHUseComModels:(NSArray *)wHUseComModels withUseCertType:(WHUseCertType)useCertType withName:(NSString *)name;
//
//+(void)checkWHUseComModel:(WHUseCertModel*)wHUseCertModel withUseCertType:(WHUseCertType)useCertType withName:(NSString *)name SuccesefulBlock:(void (^)(NSString *result))succese andFailureBlock:(void (^)(NSString *msg))failure;
//
///**********************************法人登陆************************************/
//
//+(void)isExistLegalSpaceLoginWHUseComModelWithName:(NSString*)name succesefulBlock:(void (^)(bool isExist))result;

+(WHUseCertModel *)getWHUseCertModel:(NSString *)certtyppe;

+(WHUseCertModel *)getWHUseCertModel:(NSString *)certtyppe dept:(NSString *)dept;

//+(void)delWHUserCertModel:(NSString *)phone sys:(NSString *)sysid succesefulBlock:(void (^)(void))succese andFailureBlock:(void (^)(NSString *msg))failure;
//
//+(void)delAllWHUserCertModel:(NSString *)phone succesefulBlock:(void (^)(void))succese andFailureBlock:(void (^)(NSString *msg))failure;

@end

NS_ASSUME_NONNULL_END
